home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / MIDI.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  19.0 KB  |  522 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        MIDI.h
  3.  
  4.      Contains:    MIDI Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1988-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __MIDI__
  19. #define __MIDI__
  20.  
  21. #ifndef __ERRORS__
  22. #include <Errors.h>
  23. #endif
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. #ifndef __MIXEDMODE__
  28. #include <MixedMode.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53. /*
  54.                         * * *  N O T E  * * * 
  55.  
  56.     This file has been updated to include MIDI 2.0 interfaces.  
  57.     
  58.     The MIDI 2.0 interfaces were developed for the classic 68K runtime.
  59.     Since then, Apple has created the PowerPC and CFM 68K runtimes.
  60.     Currently, the extra functions in MIDI 2.0 are not in InterfaceLib
  61.     and thus not callable from PowerPC and CFM 68K runtimes (you'll
  62.     get a linker error).  
  63. */
  64.  
  65.  
  66. enum {
  67.     midiMaxNameLen                = 31                            /*maximum number of characters in port and client names*/
  68. };
  69.  
  70.  
  71. enum {
  72.                                                                 /* Time formats */
  73.     midiFormatMSec                = 0,                            /*milliseconds*/
  74.     midiFormatBeats                = 1,                            /*beats*/
  75.     midiFormat24fpsBit            = 2,                            /*24 frames/sec.*/
  76.     midiFormat25fpsBit            = 3,                            /*25 frames/sec.*/
  77.     midiFormat30fpsDBit            = 4,                            /*30 frames/sec. drop-frame*/
  78.     midiFormat30fpsBit            = 5,                            /*30 frames/sec.*/
  79.     midiFormat24fpsQF            = 6,                            /*24 frames/sec. longInt format */
  80.     midiFormat25fpsQF            = 7,                            /*25 frames/sec. longInt format */
  81.     midiFormat30fpsDQF            = 8,                            /*30 frames/sec. drop-frame longInt format */
  82.     midiFormat30fpsQF            = 9                                /*30 frames/sec. longInt format */
  83. };
  84.  
  85.  
  86. enum {
  87.     midiInternalSync            = 0,                            /*internal sync*/
  88.     midiExternalSync            = 1                                /*external sync*/
  89. };
  90.  
  91.  
  92. enum {
  93.                                                                 /* Port types*/
  94.     midiPortTypeTime            = 0,                            /*time port*/
  95.     midiPortTypeInput            = 1,                            /*input port*/
  96.     midiPortTypeOutput            = 2,                            /*output port*/
  97.     midiPortTypeTimeInv            = 3,                            /*invisible time port*/
  98.     midiPortInvisible            = 0x8000,                        /*logical OR this to other types to make invisible ports*/
  99.     midiPortTypeMask            = 0x0007                        /*logical AND with this to convert new port types to old, i.e. to strip the property bits*/
  100. };
  101.  
  102.  
  103. enum {
  104.                                                                 /* OffsetTimes  */
  105.     midiGetEverything            = 0x7FFFFFFF,                    /*get all packets, regardless of time stamps*/
  106.     midiGetNothing                = (long)0x80000000,                /*get no packets, regardless of time stamps*/
  107.     midiGetCurrent                = 0x00000000                    /*get current packets only*/
  108. };
  109.  
  110. /*    MIDI data and messages are passed in MIDIPacket records (see below).
  111.     The first byte of every MIDIPacket contains a set of flags
  112.  
  113.     bits 0-1    00 = new MIDIPacket, not continued
  114.                      01 = begining of continued MIDIPacket
  115.                      10 = end of continued MIDIPacket
  116.                      11 = continuation
  117.     bits 2-3     reserved
  118.  
  119.     bits 4-6      000 = packet contains MIDI data
  120.  
  121.                   001 = packet contains MIDI Manager message
  122.  
  123.     bit 7         0 = MIDIPacket has valid stamp
  124.                   1 = stamp with current clock
  125. */
  126.  
  127. enum {
  128.     midiContMask                = 0x03,
  129.     midiNoCont                    = 0x00,
  130.     midiStartCont                = 0x01,
  131.     midiMidCont                    = 0x03,
  132.     midiEndCont                    = 0x02,
  133.     midiTypeMask                = 0x70,
  134.     midiMsgType                    = 0x00,
  135.     midiMgrType                    = 0x10,
  136.     midiTimeStampMask            = 0x80,
  137.     midiTimeStampCurrent        = 0x80,
  138.     midiTimeStampValid            = 0x00
  139. };
  140.  
  141.  
  142. enum {
  143.                                                                 /* MIDIPacket command words (the first word in the data field for midiMgrType messages) */
  144.     midiOverflowErr                = 0x0001,
  145.     midiSCCErr                    = 0x0002,
  146.     midiPacketErr                = 0x0003,                        /*all command words less than this value are error indicators*/
  147.     midiMaxErr                    = 0x00FF
  148. };
  149.  
  150.  
  151. enum {
  152.                                                                 /* Valid results to be returned by readHooks */
  153.     midiKeepPacket                = 0,
  154.     midiMorePacket                = 1,
  155.     midiNoMorePacket            = 2,
  156.     midiHoldPacket                = 3
  157. };
  158.  
  159.  
  160. enum {
  161.                                                                 /* Driver calls */
  162.     midiOpenDriver                = 1,
  163.     midiCloseDriver                = 2
  164. };
  165.  
  166.  
  167. enum {
  168.     mdvrAbortNotesOff            = 0,                            /*abort previous mdvrNotesOff request*/
  169.     mdvrChanNotesOff            = 1,                            /*generate channel note off messages*/
  170.     mdvrAllNotesOff                = 2,                            /*generate all note off messages*/
  171.     mdvrStopOut                    = 0,                            /*stop calling MDVROut temporarily*/
  172.     mdvrStartOut                = 1                                /*resume calling MDVROut*/
  173. };
  174.  
  175. struct MIDIPacket {
  176.     UInt8                             flags;
  177.     UInt8                             len;
  178.     long                             tStamp;
  179.     UInt8                             data[249];
  180. };
  181. typedef struct MIDIPacket MIDIPacket;
  182.  
  183. typedef MIDIPacket *                    MIDIPacketPtr;
  184. typedef CALLBACK_API( short , MIDIReadHookProcPtr )(MIDIPacketPtr myPacket, long myRefCon);
  185. typedef CALLBACK_API( void , MIDITimeProcPtr )(long curTime, long myRefCon);
  186. typedef CALLBACK_API( void , MIDIConnectionProcPtr )(short refnum, long refcon, short portType, OSType clientID, OSType portID, Boolean connect, short direction);
  187. typedef CALLBACK_API( long , MDVRCommProcPtr )(short refnum, short request, long refCon);
  188. typedef CALLBACK_API( void , MDVRTimeCodeProcPtr )(short refnum, short newFormat, long refCon);
  189. typedef CALLBACK_API( void , MDVRReadProcPtr )(char *midiChars, short length, long refCon);
  190. typedef STACK_UPP_TYPE(MIDIReadHookProcPtr)                     MIDIReadHookUPP;
  191. typedef STACK_UPP_TYPE(MIDITimeProcPtr)                         MIDITimeUPP;
  192. typedef STACK_UPP_TYPE(MIDIConnectionProcPtr)                     MIDIConnectionUPP;
  193. typedef STACK_UPP_TYPE(MDVRCommProcPtr)                         MDVRCommUPP;
  194. typedef STACK_UPP_TYPE(MDVRTimeCodeProcPtr)                     MDVRTimeCodeUPP;
  195. typedef STACK_UPP_TYPE(MDVRReadProcPtr)                         MDVRReadUPP;
  196. struct MIDIClkInfo {
  197.     short                             syncType;                    /*synchronization external/internal*/
  198.     long                             curTime;                    /*current value of port's clock*/
  199.     short                             format;                        /*time code format*/
  200. };
  201. typedef struct MIDIClkInfo MIDIClkInfo;
  202.  
  203. struct MIDIIDRec {
  204.     OSType                             clientID;
  205.     OSType                             portID;
  206. };
  207. typedef struct MIDIIDRec MIDIIDRec;
  208.  
  209. struct MIDIPortInfo {
  210.     short                             portType;                    /*type of port*/
  211.     MIDIIDRec                         timeBase;                    /*MIDIIDRec for time base*/
  212.     short                             numConnects;                /*number of connections*/
  213.     MIDIIDRec                         cList[1];                    /*ARRAY [1..numConnects] of MIDIIDRec*/
  214. };
  215. typedef struct MIDIPortInfo MIDIPortInfo;
  216.  
  217. typedef MIDIPortInfo *                    MIDIPortInfoPtr;
  218. typedef MIDIPortInfoPtr *                MIDIPortInfoHdl;
  219. typedef MIDIPortInfoPtr *                MIDIPortInfoHandle;
  220. struct MIDIPortParams {
  221.     OSType                             portID;                        /*ID of port, unique within client*/
  222.     short                             portType;                    /*Type of port - input, output, time, etc.*/
  223.     short                             timeBase;                    /*refnum of time base, 0 if none*/
  224.     long                             offsetTime;                    /*offset for current time stamps*/
  225.     MIDIReadHookProcPtr             readHook;                    /*routine to call when input data is valid*/
  226.     long                             refCon;                        /*refcon for port (for client use)*/
  227.     MIDIClkInfo                     initClock;                    /*initial settings for a time base*/
  228.     Str255                             name;                        /*name of the port, This is a real live string, not a ptr.*/
  229. };
  230. typedef struct MIDIPortParams MIDIPortParams;
  231.  
  232. typedef MIDIPortParams *                MIDIPortParamsPtr;
  233. struct MIDIIDList {
  234.     short                             numIDs;
  235.     OSType                             list[1];
  236. };
  237. typedef struct MIDIIDList MIDIIDList;
  238.  
  239. typedef MIDIIDList *                    MIDIIDListPtr;
  240. typedef MIDIIDListPtr *                    MIDIIDListHdl;
  241. typedef MIDIIDListPtr *                    MIDIIDListHandle;
  242. /* MDVR Control structs*/
  243. struct MDVRInCtlRec {
  244.     short                             timeCodeClock;                /*refnum of time base for time code*/
  245.     short                             timeCodeFormat;                /*format of time code output*/
  246.     MDVRReadProcPtr                 readProc;                    /*proc to call with intput characters*/
  247.     MDVRCommProcPtr                 commProc;                    /*proc to call for handshaking*/
  248.     long                             refCon;                        /*refCon passed to readProc, commProc*/
  249. };
  250. typedef struct MDVRInCtlRec MDVRInCtlRec;
  251.  
  252. typedef MDVRInCtlRec *                    MDVRInCtlPtr;
  253. struct MDVROutCtlRec {
  254.     short                             timeCodeClock;                /*time base driven by time code*/
  255.     short                             timeCodeFormat;                /*format of time code to listen to*/
  256.     MDVRTimeCodeProcPtr             timeCodeProc;                /*proc called on time code fmt change*/
  257.     MDVRCommProcPtr                 commProc;                    /*proc called for handshaking*/
  258.     long                             refCon;                        /*refCon passed to timeCodeProc*/
  259.     Boolean                         timeCodeFilter;                /*filter time code if true*/
  260.     UInt8                             padding;                    /*unused pad byte*/
  261.     long                             midiMsgTicks;                /*value of Ticks when MIDI msg rcvd*/
  262.     long                             timeCodeTicks;                /*value of Ticks when time code rcvd*/
  263. };
  264. typedef struct MDVROutCtlRec MDVROutCtlRec;
  265.  
  266. typedef MDVROutCtlRec *                    MDVROutCtlPtr;
  267. typedef void *                            MDVRPtr;
  268. EXTERN_API( NumVersion )
  269. MIDIVersion                        (void)                                                        FOURWORDINLINE(0x203C, 0x0000, 0x0004, 0xA800);
  270.  
  271. EXTERN_API( OSErr )
  272. MIDISignIn                        (OSType                 clientID,
  273.                                  long                     refCon,
  274.                                  Handle                 icon,
  275.                                  ConstStr255Param         name)                                FOURWORDINLINE(0x203C, 0x0004, 0x0004, 0xA800);
  276.  
  277. EXTERN_API( void )
  278. MIDISignOut                        (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0008, 0x0004, 0xA800);
  279.  
  280. EXTERN_API( MIDIIDListHandle )
  281. MIDIGetClients                    (void)                                                        FOURWORDINLINE(0x203C, 0x000C, 0x0004, 0xA800);
  282.  
  283. EXTERN_API( void )
  284. MIDIGetClientName                (OSType                 clientID,
  285.                                  Str255                 name)                                FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xA800);
  286.  
  287. EXTERN_API( void )
  288. MIDISetClientName                (OSType                 clientID,
  289.                                  ConstStr255Param         name)                                FOURWORDINLINE(0x203C, 0x0014, 0x0004, 0xA800);
  290.  
  291. EXTERN_API( MIDIIDListHandle )
  292. MIDIGetPorts                    (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0018, 0x0004, 0xA800);
  293.  
  294. EXTERN_API( OSErr )
  295. MIDIAddPort                        (OSType                 clientID,
  296.                                  short                     BufSize,
  297.                                  short *                refnum,
  298.                                  MIDIPortParamsPtr         init)                                FOURWORDINLINE(0x203C, 0x001C, 0x0004, 0xA800);
  299.  
  300. EXTERN_API( MIDIPortInfoHandle )
  301. MIDIGetPortInfo                    (OSType                 clientID,
  302.                                  OSType                 portID)                                FOURWORDINLINE(0x203C, 0x0020, 0x0004, 0xA800);
  303.  
  304. EXTERN_API( OSErr )
  305. MIDIConnectData                    (OSType                 srcClID,
  306.                                  OSType                 srcPortID,
  307.                                  OSType                 dstClID,
  308.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x0024, 0x0004, 0xA800);
  309.  
  310. EXTERN_API( OSErr )
  311. MIDIUnConnectData                (OSType                 srcClID,
  312.                                  OSType                 srcPortID,
  313.                                  OSType                 dstClID,
  314.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x0028, 0x0004, 0xA800);
  315.  
  316. EXTERN_API( OSErr )
  317. MIDIConnectTime                    (OSType                 srcClID,
  318.                                  OSType                 srcPortID,
  319.                                  OSType                 dstClID,
  320.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x002C, 0x0004, 0xA800);
  321.  
  322. EXTERN_API( OSErr )
  323. MIDIUnConnectTime                (OSType                 srcClID,
  324.                                  OSType                 srcPortID,
  325.                                  OSType                 dstClID,
  326.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x0030, 0x0004, 0xA800);
  327.  
  328. EXTERN_API( void )
  329. MIDIFlush                        (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0034, 0x0004, 0xA800);
  330.  
  331. EXTERN_API( ProcPtr )
  332. MIDIGetReadHook                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0038, 0x0004, 0xA800);
  333.  
  334. EXTERN_API( void )
  335. MIDISetReadHook                    (short                     refnum,
  336.                                  ProcPtr                 hook)                                FOURWORDINLINE(0x203C, 0x003C, 0x0004, 0xA800);
  337.  
  338. EXTERN_API( void )
  339. MIDIGetPortName                    (OSType                 clientID,
  340.                                  OSType                 portID,
  341.                                  Str255                 name)                                FOURWORDINLINE(0x203C, 0x0040, 0x0004, 0xA800);
  342.  
  343. EXTERN_API( void )
  344. MIDISetPortName                    (OSType                 clientID,
  345.                                  OSType                 portID,
  346.                                  ConstStr255Param         name)                                FOURWORDINLINE(0x203C, 0x0044, 0x0004, 0xA800);
  347.  
  348. EXTERN_API( void )
  349. MIDIWakeUp                        (short                     refnum,
  350.                                  long                     time,
  351.                                  long                     period,
  352.                                  MIDITimeProcPtr         timeProc)                            FOURWORDINLINE(0x203C, 0x0048, 0x0004, 0xA800);
  353.  
  354. EXTERN_API( void )
  355. MIDIRemovePort                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x004C, 0x0004, 0xA800);
  356.  
  357. EXTERN_API( short )
  358. MIDIGetSync                        (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0050, 0x0004, 0xA800);
  359.  
  360. EXTERN_API( void )
  361. MIDISetSync                        (short                     refnum,
  362.                                  short                     sync)                                FOURWORDINLINE(0x203C, 0x0054, 0x0004, 0xA800);
  363.  
  364. EXTERN_API( long )
  365. MIDIGetCurTime                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0058, 0x0004, 0xA800);
  366.  
  367. EXTERN_API( void )
  368. MIDISetCurTime                    (short                     refnum,
  369.                                  long                     time)                                FOURWORDINLINE(0x203C, 0x005C, 0x0004, 0xA800);
  370.  
  371. EXTERN_API( void )
  372. MIDIStartTime                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0060, 0x0004, 0xA800);
  373.  
  374. EXTERN_API( void )
  375. MIDIStopTime                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0064, 0x0004, 0xA800);
  376.  
  377. EXTERN_API( void )
  378. MIDIPoll                        (short                     refnum,
  379.                                  long                     offsetTime)                            FOURWORDINLINE(0x203C, 0x0068, 0x0004, 0xA800);
  380.  
  381. EXTERN_API( OSErr )
  382. MIDIWritePacket                    (short                     refnum,
  383.                                  MIDIPacketPtr             packet)                                FOURWORDINLINE(0x203C, 0x006C, 0x0004, 0xA800);
  384.  
  385. EXTERN_API( Boolean )
  386. MIDIWorldChanged                (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0070, 0x0004, 0xA800);
  387.  
  388. EXTERN_API( long )
  389. MIDIGetOffsetTime                (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0074, 0x0004, 0xA800);
  390.  
  391. EXTERN_API( void )
  392. MIDISetOffsetTime                (short                     refnum,
  393.                                  long                     offsetTime)                            FOURWORDINLINE(0x203C, 0x0078, 0x0004, 0xA800);
  394.  
  395. EXTERN_API( long )
  396. MIDIConvertTime                    (short                     srcFormat,
  397.                                  short                     dstFormat,
  398.                                  long                     time)                                FOURWORDINLINE(0x203C, 0x007C, 0x0004, 0xA800);
  399.  
  400. EXTERN_API( long )
  401. MIDIGetRefCon                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0080, 0x0004, 0xA800);
  402.  
  403. EXTERN_API( void )
  404. MIDISetRefCon                    (short                     refnum,
  405.                                  long                     refCon)                                FOURWORDINLINE(0x203C, 0x0084, 0x0004, 0xA800);
  406.  
  407. EXTERN_API( long )
  408. MIDIGetClRefCon                    (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0088, 0x0004, 0xA800);
  409.  
  410. EXTERN_API( void )
  411. MIDISetClRefCon                    (OSType                 clientID,
  412.                                  long                     refCon)                                FOURWORDINLINE(0x203C, 0x008C, 0x0004, 0xA800);
  413.  
  414. EXTERN_API( short )
  415. MIDIGetTCFormat                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0090, 0x0004, 0xA800);
  416.  
  417. EXTERN_API( void )
  418. MIDISetTCFormat                    (short                     refnum,
  419.                                  short                     format)                                FOURWORDINLINE(0x203C, 0x0094, 0x0004, 0xA800);
  420.  
  421. EXTERN_API( void )
  422. MIDISetRunRate                    (short                     refnum,
  423.                                  short                     rate,
  424.                                  long                     time)                                FOURWORDINLINE(0x203C, 0x0098, 0x0004, 0xA800);
  425.  
  426. EXTERN_API( Handle )
  427. MIDIGetClientIcon                (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x009C, 0x0004, 0xA800);
  428.  
  429. EXTERN_API( ProcPtr )
  430. MIDICallAddress                    (short                     callNum)                            FOURWORDINLINE(0x203C, 0x00A4, 0x0004, 0xA800);
  431.  
  432. EXTERN_API( void )
  433. MIDISetConnectionProc            (short                     refNum,
  434.                                  ProcPtr                 connectionProc,
  435.                                  long                     refCon)                                FOURWORDINLINE(0x203C, 0x00A8, 0x0004, 0xA800);
  436.  
  437. EXTERN_API( void )
  438. MIDIGetConnectionProc            (short                     refnum,
  439.                                  ProcPtr *                connectionProc,
  440.                                  long *                    refCon)                                FOURWORDINLINE(0x203C, 0x00AC, 0x0004, 0xA800);
  441.  
  442. EXTERN_API( void )
  443. MIDIDiscardPacket                (short                     refnum,
  444.                                  MIDIPacketPtr             packet)                                FOURWORDINLINE(0x203C, 0x00B0, 0x0004, 0xA800);
  445.  
  446. EXTERN_API( OSErr )
  447. MDVRSignIn                        (OSType                 clientID,
  448.                                  long                     refCon,
  449.                                  Handle                 icon,
  450.                                  Str255                 name)                                FOURWORDINLINE(0x203C, 0x00B4, 0x0004, 0xA800);
  451.  
  452. EXTERN_API( void )
  453. MDVRSignOut                        (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x00B8, 0x0004, 0xA800);
  454.  
  455. EXTERN_API( MDVRPtr )
  456. MDVROpen                        (short                     portType,
  457.                                  short                     refnum)                                FOURWORDINLINE(0x203C, 0x00BC, 0x0004, 0xA800);
  458.  
  459. EXTERN_API( void )
  460. MDVRClose                        (MDVRPtr                 driverPtr)                            FOURWORDINLINE(0x203C, 0x00C0, 0x0004, 0xA800);
  461.  
  462. EXTERN_API( void )
  463. MDVRControlIn                    (MDVRPtr                 portPtr,
  464.                                  MDVRInCtlPtr             inputCtl)                            FOURWORDINLINE(0x203C, 0x00C4, 0x0004, 0xA800);
  465.  
  466. EXTERN_API( void )
  467. MDVRControlOut                    (MDVRPtr                 portPtr,
  468.                                  MDVROutCtlPtr             outputCtl)                            FOURWORDINLINE(0x203C, 0x00C8, 0x0004, 0xA800);
  469.  
  470. EXTERN_API( void )
  471. MDVRIn                            (MDVRPtr                 portPtr)                            FOURWORDINLINE(0x203C, 0x00CC, 0x0004, 0xA800);
  472.  
  473. EXTERN_API( void )
  474. MDVROut                            (MDVRPtr                 portPtr,
  475.                                  char *                    dataPtr,
  476.                                  short                     length)                                FOURWORDINLINE(0x203C, 0x00D0, 0x0004, 0xA800);
  477.  
  478. EXTERN_API( void )
  479. MDVRNotesOff                    (MDVRPtr                 portPtr,
  480.                                  short                     mode)                                FOURWORDINLINE(0x203C, 0x00D4, 0x0004, 0xA800);
  481.  
  482. enum { uppMIDIReadHookProcInfo = 0x000003E0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  483. enum { uppMIDITimeProcInfo = 0x000003C0 };                         /* pascal no_return_value Func(4_bytes, 4_bytes) */
  484. enum { uppMIDIConnectionProcInfo = 0x0009FB80 };                 /* pascal no_return_value Func(2_bytes, 4_bytes, 2_bytes, 4_bytes, 4_bytes, 1_byte, 2_bytes) */
  485. enum { uppMDVRCommProcInfo = 0x00000EB0 };                         /* pascal 4_bytes Func(2_bytes, 2_bytes, 4_bytes) */
  486. enum { uppMDVRTimeCodeProcInfo = 0x00000E80 };                     /* pascal no_return_value Func(2_bytes, 2_bytes, 4_bytes) */
  487. enum { uppMDVRReadProcInfo = 0x00000EC0 };                         /* pascal no_return_value Func(4_bytes, 2_bytes, 4_bytes) */
  488. #define NewMIDIReadHookProc(userRoutine)                         (MIDIReadHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDIReadHookProcInfo, GetCurrentArchitecture())
  489. #define NewMIDITimeProc(userRoutine)                             (MIDITimeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDITimeProcInfo, GetCurrentArchitecture())
  490. #define NewMIDIConnectionProc(userRoutine)                         (MIDIConnectionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDIConnectionProcInfo, GetCurrentArchitecture())
  491. #define NewMDVRCommProc(userRoutine)                             (MDVRCommUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMDVRCommProcInfo, GetCurrentArchitecture())
  492. #define NewMDVRTimeCodeProc(userRoutine)                         (MDVRTimeCodeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMDVRTimeCodeProcInfo, GetCurrentArchitecture())
  493. #define NewMDVRReadProc(userRoutine)                             (MDVRReadUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMDVRReadProcInfo, GetCurrentArchitecture())
  494. #define CallMIDIReadHookProc(userRoutine, myPacket, myRefCon)     CALL_TWO_PARAMETER_UPP((userRoutine), uppMIDIReadHookProcInfo, (myPacket), (myRefCon))
  495. #define CallMIDITimeProc(userRoutine, curTime, myRefCon)         CALL_TWO_PARAMETER_UPP((userRoutine), uppMIDITimeProcInfo, (curTime), (myRefCon))
  496. #define CallMIDIConnectionProc(userRoutine, refnum, refcon, portType, clientID, portID, connect, direction)  CALL_SEVEN_PARAMETER_UPP((userRoutine), uppMIDIConnectionProcInfo, (refnum), (refcon), (portType), (clientID), (portID), (connect), (direction))
  497. #define CallMDVRCommProc(userRoutine, refnum, request, refCon)     CALL_THREE_PARAMETER_UPP((userRoutine), uppMDVRCommProcInfo, (refnum), (request), (refCon))
  498. #define CallMDVRTimeCodeProc(userRoutine, refnum, newFormat, refCon)  CALL_THREE_PARAMETER_UPP((userRoutine), uppMDVRTimeCodeProcInfo, (refnum), (newFormat), (refCon))
  499. #define CallMDVRReadProc(userRoutine, midiChars, length, refCon)  CALL_THREE_PARAMETER_UPP((userRoutine), uppMDVRReadProcInfo, (midiChars), (length), (refCon))
  500.  
  501.  
  502. #if PRAGMA_STRUCT_ALIGN
  503.     #pragma options align=reset
  504. #elif PRAGMA_STRUCT_PACKPUSH
  505.     #pragma pack(pop)
  506. #elif PRAGMA_STRUCT_PACK
  507.     #pragma pack()
  508. #endif
  509.  
  510. #ifdef PRAGMA_IMPORT_OFF
  511. #pragma import off
  512. #elif PRAGMA_IMPORT
  513. #pragma import reset
  514. #endif
  515.  
  516. #ifdef __cplusplus
  517. }
  518. #endif
  519.  
  520. #endif /* __MIDI__ */
  521.  
  522.